package com.zq.spring.condition;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: zhaoqi
 * @Date: 2020/4/30 15:15
 * @Version 1.0
 */

@Configuration
@ComponentScan("com.zq.spring.condition")
public class JavaConfigCondition {

    @Bean
    @Conditional(WindowsCondition.class)
    public ListService windowsCondition(){
        return new WindowsService();
    }

    @Bean
    @Conditional(LinuxCondition.class)
    public ListService linuxCondition(){
        return new linuxService();
    }


}
